const path = require('path')

module.exports = {
    assetsDir: 'server/src/public',
    transpileDependencies: true,
    configureWebpack: {
        resolve: {
            fallback: {
                "path": require.resolve("path-browserify")
            },
            alias: {
                '@': path.resolve(__dirname, 'src')
            }
        },
    },
    devServer: {
        port: 8081,
        open: true, // 自动打开浏览器
        proxy: {
            "/api": {
                target: "http://localhost:3000",
                secure: false,
                changeOrigin: true,
                pathRewrite: {
                    "^/api": "/api",
                },
            },
            "/upload": {
                target: "http://localhost:3000",
                secure: false,
                changeOrigin: true,
                pathRewrite: {
                    "^/upload": "/upload",
                },
            }
        },
    },
}
